var r = !1, t = void 0, e = void 0;

!function() {
    var n = wx.getSystemInfoSync();
    r = "ios" === n.platform;
    var o = n.screenWidth || 375, i = n.pixelRatio || 2;
    o === t && i === e || (t = o, e = i);
}();

var n = function(n) {
    return 0 === n ? 0 : (n = n / 750 * t, 0 === (n = Math.floor(n + 1e-4)) ? 1 !== e && r ? .5 : 1 : n);
}, o = /([+-]?\d+(?:\.\d+)?)rpx/gi;

module.exports = {
    transformRpx: function(r, t) {
        if ("string" != typeof r) return r;
        var e = o;
        return r.replace(e, function(r, e) {
            return n(Number(e)) + (t ? "px" : "");
        });
    }
};